package de.wesemann.jdedun.entities.mediahandbook.people;

import de.wesemann.jdedun.entities.AbstractEntity;

public class MediahandbookPeople extends AbstractEntity {
    /** id des Unternehmens für welches die Person arbeitet */
    private int company_id;

    /** Vorname der Person */
    private String first_name;
    /** Nachname der Person */
    private String last_name;
    /**
     * Titel der Person, z.B. Doktor
     */
    private String title;
    /**
     * Bezeichnung der Position im Unternehmen
     */
    private String position;
    /**
     * Funktion, kann entweder manager oder contact sein
     */
    private String occupation;

    /**
     * id des Unternehmens für welches die Person arbeitet
     * 
     * @return the company_id
     */
    public int getCompany_id() {
	return company_id;
    }

    /**
     * id des Unternehmens für welches die Person arbeitet
     * 
     * @param company_id
     *            the company_id to set
     */
    public void setCompany_id(int company_id) {
	this.company_id = company_id;
    }

    /**
     * Vorname der Person
     * 
     * @return the first_name
     */
    public String getFirst_name() {
	return first_name;
    }

    /**
     * Vorname der Person
     * 
     * @param first_name
     *            the first_name to set
     */
    public void setFirst_name(String first_name) {
	this.first_name = first_name;
    }

    /**
     * Nachname der Person
     * 
     * @return the last_name
     */
    public String getLast_name() {
	return last_name;
    }

    /**
     * Nachname der Person
     * 
     * @param last_name
     *            the last_name to set
     */
    public void setLast_name(String last_name) {
	this.last_name = last_name;
    }

    /**
     * Titel der Person, z.B. Doktor
     * 
     * @return the title
     */
    public String getTitle() {
	return title;
    }

    /**
     * Titel der Person, z.B. Doktor
     * 
     * @param title
     *            the title to set
     */
    public void setTitle(String title) {
	this.title = title;
    }

    /**
     * Bezeichnung der Position im Unternehmen
     * 
     * @return the position
     */
    public String getPosition() {
	return position;
    }

    /**
     * Bezeichnung der Position im Unternehmen
     * 
     * @param position
     *            the position to set
     */
    public void setPosition(String position) {
	this.position = position;
    }

    /**
     * Funktion, kann entweder manager oder contact sein
     * 
     * @return the occupation
     */
    public String getOccupation() {
	return occupation;
    }

    /**
     * Funktion, kann entweder manager oder contact sein
     * 
     * @param occupation
     *            the occupation to set
     */
    public void setOccupation(String occupation) {
	this.occupation = occupation;
    }

    /* (non-Javadoc)
     * @see java.lang.Object#hashCode()
     */
    @Override
    public int hashCode() {
	final int prime = 31;
	int result = super.hashCode();
	result = prime * result + company_id;
	result = prime * result
		+ ((first_name == null) ? 0 : first_name.hashCode());
	result = prime * result
		+ ((last_name == null) ? 0 : last_name.hashCode());
	result = prime * result
		+ ((occupation == null) ? 0 : occupation.hashCode());
	result = prime * result
		+ ((position == null) ? 0 : position.hashCode());
	result = prime * result + ((title == null) ? 0 : title.hashCode());
	return result;
    }

    /* (non-Javadoc)
     * @see java.lang.Object#equals(java.lang.Object)
     */
    @Override
    public boolean equals(Object obj) {
	if (this == obj) {
	    return true;
	}
	if (!super.equals(obj)) {
	    return false;
	}
	if (getClass() != obj.getClass()) {
	    return false;
	}
	MediahandbookPeople other = (MediahandbookPeople) obj;
	if (company_id != other.company_id) {
	    return false;
	}
	if (first_name == null) {
	    if (other.first_name != null) {
		return false;
	    }
	} else if (!first_name.equals(other.first_name)) {
	    return false;
	}
	if (last_name == null) {
	    if (other.last_name != null) {
		return false;
	    }
	} else if (!last_name.equals(other.last_name)) {
	    return false;
	}
	if (occupation == null) {
	    if (other.occupation != null) {
		return false;
	    }
	} else if (!occupation.equals(other.occupation)) {
	    return false;
	}
	if (position == null) {
	    if (other.position != null) {
		return false;
	    }
	} else if (!position.equals(other.position)) {
	    return false;
	}
	if (title == null) {
	    if (other.title != null) {
		return false;
	    }
	} else if (!title.equals(other.title)) {
	    return false;
	}
	return true;
    }

    /*
     * (non-Javadoc)
     * 
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
	return String
		.format("MediahandbookPeople [company_id=%s, first_name=%s, last_name=%s, title=%s, position=%s, occupation=%s]",
			company_id, first_name, last_name, title, position,
			occupation);
    }

}
